package com.hsh.maoduo.controller;

import com.hsh.maoduo.common.Result;
import com.hsh.maoduo.pojo.dto.InboundDTO;
import com.hsh.maoduo.pojo.vo.InboundVO;
import com.hsh.maoduo.service.InboundService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/inbound")
public class InboundController {


    @Resource
    private InboundService inboundService;

    @GetMapping("/list")
    public List<InboundDTO> getList(InboundVO inboundVO) {
        return inboundService.getList(inboundVO);
    }


    @PostMapping("/addList")
    public Result addList(@RequestBody List<InboundVO> inboundVOList) {
        return inboundService.addList(inboundVOList);
    }


    @PostMapping("/update")
    public Result update(InboundVO inboundVO) {
        return inboundService.update(inboundVO);
    }

    @PostMapping("/delete")
    public Result delete(int id) {
        return inboundService.delete(id);
    }
}
